package cn.hehuoren.quartz.dao;

import cn.hehuoren.quartz.model.QuartzManager;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface QuartzManagerMapper {
	/**
	 * 查询调度任务信息
	 * 
	 * @param
	 * @return
	 */
	List<QuartzManager> select(@Param("start") Integer start,
							   @Param("num") Integer num,
							   @Param("dtlSchedName") String dtlSchedName,
							   @Param("dtlJobName") String dtlJobName,
							   @Param("dtlJobGroup") String dtlJobGroup,
							   @Param("dtlDescription") String dtlDescription);

	QuartzManager getByKey(@Param("dtlSchedName") String dtlSchedName, @Param("dtlJobName") String dtlJobName,
                           @Param("dtlJobGroup") String dtlJobGroup);

	int getTotal(
            @Param("dtlSchedName") String dtlSchedName,
            @Param("dtlJobName") String dtlJobName,
            @Param("dtlJobGroup") String dtlJobGroup,
            @Param("dtlDescription") String dtlDescription);

	int deleteQrtzJobDetails(QuartzManager quartzManager);

	int deleteQrtzTriggers(QuartzManager quartzManager);

	int deleteQrtzCronTriggers(QuartzManager quartzManager);
	
	int runSingleTime(@Param("trigTriggerName") String trigTriggerName, @Param("trigTriggerGroup") String trigTriggerGroup);
	
	String checkJobIsComplete(@Param("trigTriggerName") String trigTriggerName, @Param("trigTriggerGroup") String trigTriggerGroup);
	
	List<QuartzManager> selectQuartzManagerPage(QuartzManager quartzManager, PageBounds pageBounds);
}
